package cp3120.view;

import cp3120.model.Credentials;
import generic.swing.LoginDialogue;

/**
 *
 * @author Adam Scarr <scarr.adam@gmail.com>
 */
public class MainUIProxy extends MainUI {
    private MainUI subject;

    public MainUIProxy(MainUI subject) {
        this.subject = subject;
        setInstance(this);

    }

    public void loginUser(final Credentials credentials) {
        new Thread(new Runnable() {
            public void run() {
                subject.getFrame().setLoggingIn(true);
                subject.loginUser(credentials);
                subject.getFrame().setLoggingIn(false);
            }
        }).start();
    }

    public MainMenu getMainMenu() {
        return subject.getMainMenu();
    }

    public LoginDialogue getLoginDialogue() {
        return subject.getLoginDialogue();
    }

    public RegistrationUI getRegistrationUI() {
        return subject.getRegistrationUI();
    }

    public ConfirmDeleteUI getConfirmDeleteUI() {
        return subject.getConfirmDeleteUI();
    }

    public RoleListView getRoleEditor() {
        return subject.getRoleEditor();
    }

    public void update() {
        subject.update();
    }

    public ActiveUsersList getActiveUserViewer() {
        return subject.getActiveUserViewer();
    }

    public AirportList getAirportEditor() {
        return subject.getAirportEditor();
    }

    public UserListView getUserEditor() {
        return subject.getUserEditor();
    }

    public MainFrame getFrame() {
        return subject.getFrame();
    }

    public FlightSearchView getFlightSearchbox() {
        return subject.getFlightSearchbox();
    }

    public PurchaseView getCurrentPurchaseView() {
        return subject.getCurrentPurchaseView();
    }
}
